package com.example.venue_reservation_service.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.venue_reservation_service.domain.VeMessage;
import com.example.venue_reservation_service.service.VeMessageService;
import com.example.venue_reservation_service.mapper.VeMessageMapper;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 31586
* @description 针对表【venue_message】的数据库操作Service实现
* @createDate 2025-06-17 15:36:33
*/
@Service
public class VeMessageServiceImpl extends ServiceImpl<VeMessageMapper, VeMessage>
    implements VeMessageService{


    @Resource
    private  VeMessageMapper messageMapper;

    @Override
    public boolean save(VeMessage message) {
        if (message.getId() == null) {
            messageMapper.insert(message);
        } else {
            messageMapper.updateById(message);
        }
        return false;
    }

    @Override
    public List<VeMessage> getBySessionId(Integer sessionId) {
        return messageMapper.selectMessagesBySessionId(sessionId);
    }

}




